import 'package:json_annotation/json_annotation.dart';

import 'identify_id_card.dart';

part 'identify_business_license.g.dart';

@JsonSerializable()
class IdentifyBusinessLicense extends Object {
  @JsonKey(name: 'log_id')
  int logId;

  @JsonKey(name: 'words_result')
  BusinessLicense wordsResult;

  @JsonKey(name: 'words_result_num')
  int wordsResultNum;

  IdentifyBusinessLicense(
    this.logId,
    this.wordsResult,
    this.wordsResultNum,
  );

  factory IdentifyBusinessLicense.fromJson(Map<String, dynamic> srcJson) => _$IdentifyBusinessLicenseFromJson(srcJson);

  Map<String, dynamic> toJson() => _$IdentifyBusinessLicenseToJson(this);
}

@JsonSerializable()
class BusinessLicense extends Object {
  @JsonKey(name: '社会信用代码')
  BDData creditCode;

  @JsonKey(name: '组成形式')
  BDData organization;

  @JsonKey(name: '经营范围')
  BDData scope;

  @JsonKey(name: '成立日期')
  BDData cTime;

  @JsonKey(name: '法人')
  BDData legalPerson;

  @JsonKey(name: '注册资本')
  BDData registeredAmount;

  @JsonKey(name: '证件编号')
  BDData idNumber;

  @JsonKey(name: '地址')
  BDData address;

  @JsonKey(name: '单位名称')
  BDData name;

  @JsonKey(name: '有效期')
  BDData validityTime;

  @JsonKey(name: '类型')
  BDData type;

  factory BusinessLicense.fromJson(Map<String, dynamic> srcJson) => _$BusinessLicenseFromJson(srcJson);

  Map<String, dynamic> toJson() => _$BusinessLicenseToJson(this);

  BusinessLicense(this.creditCode, this.organization, this.scope, this.cTime, this.legalPerson, this.registeredAmount, this.idNumber, this.address, this.name,
      this.validityTime, this.type);
}
